\testfile{pgfplotstest.3d.tex}
\testsection{View}%
\begingroup

The following test plot has


%\pgfplotsset{ticklabel pos=upper}

\def\testplot#1#2{%
	\message{RUNNING WITH azimuth={#1}; elevation={#2}...}
	\starttikzpicture
	%\tracingmacros=2 \tracingcommands=2
		\startaxis[
			enlargelimits=false,
			view={#1}{#2},
			%view={0}{0},
			%disabledatascaling,
			clip=false,
			y domain=0:1,domain=0:1]
			\addplot3[blue,-stealth,thick] coordinates {(0,0,0) (1,0,0) (0,2,0) (0,0,3)};
		%	\addplot3+[only marks,scatter] plot[samples=15,scatter src=z] (\x,\y,\x^2 * \y^2);
		\stopaxis
	\stoptikzpicture
}%

\testsubsection{Test von YAW}
\def\p{50}
\foreach \y in {0,30,50,80,120,180,200,240,260,300,350} {
	\edef\ARG{für \{\y\}\{\p\}:}
	\expandafter\subsubsection\expandafter{\ARG}
	\testplot{\y}{\p}\hfill
}

\testsubsection{Test von PITCH}
\def\y{-30}
\foreach \p in {0,30,50,80,90,-90,-80,-50,-30,0} {%120,180,200,240,260,300,350} {
	\edef\ARG{für \{\y\}\{\p\}:}
	\expandafter\subsubsection\expandafter{\ARG}
	\testplot{\y}{\p}\hfill
}

%\tracingmacros=2 \tracingcommands=2
\testsubsubsection{Special case view=0,0}
\testplot{0}{0}\hfill

\testsubsubsection{Special case view=90,0}
\testplot{90}{0}\hfill

\testsubsubsection{Special case view=-90,0}
\testplot{-90}{0}\hfill

\testsubsubsection{Special case view=0,90}
\testplot{0}{90}\hfill

\testsubsubsection{Special case view=0,-90}
\testplot{0}{-90}\hfill

\testsubsubsection{Special case view=90,90}
\testplot{90}{90}\hfill


\testsection{Tests and Debugging of near ticklabel anchors}
{
	\pgfplotsset{
		clip=false,
		compat=newest,
		xlabel=$x$ label,
		ylabel=$y$ label,
		zlabel=$z$ label,
		every 3d description/.append style={
			ticklabel style={draw=red},
			label style={draw=red},
			xlabel style={name=xlabel},
			ylabel style={name=ylabel},
			zlabel style={name=zlabel},
		},
		extra description/.add code={%
			\draw[blue,thick,->] (xticklabel cs:0,0) -- (xticklabel cs:1,0);
			\draw[blue,thick,->] (yticklabel cs:0,0) -- (yticklabel cs:1,0);
			\ifpgfplotsthreedim
			\draw[blue,thick,->] (zticklabel cs:0,0) -- (zticklabel cs:1,0);
			\fi
			%
			\draw[red,thick,->] (xticklabel cs:0.5,0pt) -- (xticklabel cs:0.5,50pt);
			%
			\fill[green] (xlabel.near xticklabel*) circle (2pt);
			\fill[green] (ylabel.near yticklabel*) circle (2pt);
			\ifpgfplotsthreedim
			\fill[green] (zlabel.near zticklabel*) circle (2pt);
			\fi
			%
			\fill[orange] (xlabel.near xticklabel) circle (2pt);
			\fill[orange] (ylabel.near yticklabel) circle (2pt);
			\ifpgfplotsthreedim
			\fill[orange] (zlabel.near zticklabel) circle (2pt);
			\fi
			%
		},
	}
	\starttikzpicture
		\startaxis[
			title={near [xyz]ticklabel},
			xlabel=a very large $x$ label,
			ylabel=a very large $y$ label,
%every axis z label/.style={at={(ticklabel cs:0.5)},anchor=near ticklabel,name=zlabel},
		]
		
		\addplot3[mesh,samples=3] {x};
		\stopaxis
	\stoptikzpicture

	\starttikzpicture
		\startaxis[
			title={near [xyz]ticklabel},
			xlabel=a very large $x$ label,
			ylabel=a very large $y$ label,
			zlabel=a very large $z$ label,
			label style={sloped},
		]
		
		\addplot3[mesh,samples=3] {x};
		\stopaxis
	\stoptikzpicture

	\starttikzpicture
		\startaxis[
			title={near [xyz]ticklabel},
			xlabel=a large $x$ label,
			ylabel=a large $y$ label,
			zlabel=a large $z$ label,
		]
		
		\addplot3[mesh,samples=3] {x};
		\stopaxis
	\stoptikzpicture

	\starttikzpicture
		\startaxis[
			title={near [xyz]ticklabel},
		]
		
		\addplot3[mesh,samples=3] {x};
		\stopaxis
	\stoptikzpicture

	\starttikzpicture
		\startaxis
			\addplot+[samples=3] {x};
		\stopaxis
	\stoptikzpicture

	\starttikzpicture
		\startaxis[
			title={near [xyz]ticklabelSTAR},
			xlabel=$x$ label,
			ylabel=$y$ label,
			xlabel style={anchor=near xticklabel*},
			ylabel style={anchor=near yticklabel*},
		]
		
		\addplot3[mesh,samples=3] {x};
		\stopaxis
	\stoptikzpicture

	{
		\pgfplotsdeclareborderanchorforticklabelaxis x{test anchor}
		\def\pgfplotspointouternormalvectorofaxisgetv#1{\def\pgfplotsretval{testdummy}}
		\starttikzpicture
		\draw (0,0) circle (5cm);
		\foreach \degree in {0,15,...,359} {
			\def\pgfplotspointouternormalvectorofaxis##1{%
				\pgfpointpolar{\degree}{1pt}
			}%
			\def\pgfplotspointunitx{\pgfpointpolar{\degree+90}{1pt}}%
			\def\pgfplotsunitxinvlength{1}%
			\draw (0,0) -- (\degree:6cm);
			\node[fill=yellow,anchor=center] at (\degree:5cm) {\degree};
			\node[
				draw=red,
				anchor=test anchor,
			] at (\degree:5cm) {label for \degree};
		}
		\stoptikzpicture
	}
}
\testsubsection{Placement of ticklabels}
{
	\pgfplotsset{
		xtick={-1,-0.5,...,1.001},
	}
		
	Here, a $-0.5$ penetrated the axis in an earlier version, should be fixed now:

	\starttikzpicture
		\startaxis[clip=false,
			xmin=-1,xmax=1,
			ymin=-1,ymax=3,
			zmin=-1,zmax=1,
			enlarge z limits,
			xlabel=$t_1$,ylabel=$t_2$,zlabel=$t_3$,width=8cm,view/h=73,view/v=63]

		\stopaxis
	\stoptikzpicture

	\starttikzpicture
		\pgfplotsset{
			ticklabel style={draw=red},
		}
		\startaxis[clip=false,
			xmin=-1,xmax=1,
			ymin=-1,ymax=3,
			zmin=-1,zmax=1,
			enlarge z limits,
			xlabel=$t_1$,ylabel=$t_2$,zlabel=$t_3$,width=8cm,view/h=73,view/v=63]

		\draw[blue,thick,->] (xticklabel cs:0,0pt) -- (xticklabel cs:1,0pt);
		\stopaxis
	\stoptikzpicture

	\testsubsubsection{mit xticklabel shift=5pt}
	\starttikzpicture
		\startaxis[clip=false,
			xticklabel shift=5pt,
			xmin=-1,xmax=1,
			ymin=-1,ymax=3,
			zmin=-1,zmax=1,
			enlarge z limits,
			xlabel=$t_1$,ylabel=$t_2$,zlabel=$t_3$,width=8cm,view/h=73,view/v=63]

		\stopaxis
	\stoptikzpicture
}

\endgroup

\testsection{Sanity checking}

%\tracingmacros=2 \tracingcommands=2
\testsubsection{addplot in 3D axis}
\starttikzpicture
	\startaxis[zmin=0,zmax=1]
		\addplot {x};
	\stopaxis
\stoptikzpicture


\testsubsection{addplot and addplot3 in an axis}
\starttikzpicture
	\startaxis
		\addplot {x};
		\addplot3 coordinates {(-5,-5,-5) (5,5,5)};
	\stopaxis
\stoptikzpicture

\testsubsection{addplot and addplot3 in an axis}
\starttikzpicture
	\startaxis
		\addplot {x};
		\addplot3 coordinates {(-5,-5,-5) (5,5,5)};
	\stopaxis
\stoptikzpicture
